/* GUI CONVERTED from ecrelsrp.p (converter v1.75) Wed Sep 27 08:25:20 2000 */
/* ecrelsrp.p  - ECN  RELEASE INCLUDE FILE                                    */
/* Copyright 1986-2002 QAD Inc., Carpinteria, CA, USA.                        */
/* All rights reserved worldwide.  This is an unpublished work.               */
/*H0CH*/ /*V8:ConvertMode=Report                                              */
/* REVISION: 7.4      LAST EDIT: 08/06/93      MODIFIED BY: QZL *H013*        */
/* REVISION: 7.4      LAST EDIT: 04/11/95      MODIFIED BY: jpm *H0CH*        */
/* REVISION: 8.6      LAST EDIT: 08/06/96       BY: Mariya Kutwal *K00C*      */
/* REVISION: 8.6E     LAST MODIFIED: 02/23/98   BY: *L007* A. Rahane          */
/* REVISION: 8.6E     LAST MODIFIED: 05/20/98   BY: *K1Q4* Alfred Tan         */
/* REVISION: 8.6E     LAST MODIFIED: 10/04/98   BY: *J314* Alfred Tan         */
/* REVISION: 9.1      LAST MODIFIED: 03/24/00   BY: *N08T* Annasaheb Rahane   */
/* REVISION: 9.1      LAST MODIFIED: 08/14/00   BY: *N0KW* Jacolyn Neder      */
/* REVISION: 9.1      LAST MODIFIED: 08/24/00   BY: *N0MZ* Rajinder Kamra     */


/*GUI preprocessor directive settings */
&SCOPED-DEFINE PP_GUI_CONVERT_MODE REPORT

         {mfdtitle.i}

/* ********** Begin Translatable Strings Definitions ********* */
/*N0MZ
 * &SCOPED-DEFINE ecrelsrp_p_1 "No copies required. Please check for possible E-mail."
 * /* MaxLen: Comment: */
 *
 * &SCOPED-DEFINE ecrelsrp_p_2 "Distributed to:"
 * /* MaxLen: Comment: */
 *
 * &SCOPED-DEFINE ecrelsrp_p_3 "Error: Distribution end date passed."
 * /* MaxLen: Comment: */
 *N0MZ*/

/* ********** End Translatable Strings Definitions ********* */

         define new shared variable ecmnbr    like ecm_nbr.

         define variable ecmid     like wo_lot.
         define variable dbase     like si_db.
         define variable i         as integer.
         define variable ii        as integer.
         define variable descpt1   as character format "x(70)".
         define variable descpt2   as character format "x(70)".
         define variable m         as integer.
         define variable n         as integer.
         define variable skip1     as character.
         define variable closed_yn like mfc_logical.
/*H0CH*/      
/*H0CH*/ define variable terminal-window as widget-handle.
/*H0CH*/ define variable save-window as widget-handle.    
         define variable progtitl like dtitle.
/*N0MZ*/ define variable l_msg1 as character format "x(64)" no-undo.
/*N0MZ*/ define variable l_msg2 as character format "x(64)" no-undo.
/*N0MZ*/ define variable disp-copy as character no-undo format "x(4)".
/*N0MZ*/ define variable disp-of as character no-undo format "x(2)".


/*N0MZ*/ /* No copies required. Please check for possible e-mail */
/*N0MZ*/ {pxmsg.i &MSGNUM=3742 &MSGBUFFER=l_msg1 &ERRORLEVEL=1}
/*N0MZ*/ /* ERROR: Distribution end date passed */
/*N0MZ*/ {pxmsg.i &MSGNUM=3743 &MSGBUFFER=l_msg2 &ERRORLEVEL=4}

/*N0MZ*/ disp-copy = getTermLabel("COPY",6).
/*N0MZ*/ disp-of  = getTermLabel("OF",4).

         
/*GUI preprocessor Frame A define */
&SCOPED-DEFINE PP_FRAME_NAME A

FORM /*GUI*/ 
            ecmnbr   format "x(24)"
            progtitl
         with frame a width 80 THREE-D /*GUI*/.

/*GUI preprocessor Frame A undefine */
&UNDEFINE PP_FRAME_NAME



         /* SET EXTERNAL LABELS */
         setFrameLabels(frame a:handle).

         FORM /*GUI*/ 
            skip(2)
/*N0MZ*     {&ecrelsrp_p_1} colon 6 */
/*N0MZ*/    l_msg1  colon 6 no-label
/*H0CH*/ with STREAM-IO /*GUI*/  frame b width 80.

         /* SET EXTERNAL LABELS */
/*N0MZ*  setFrameLabels(frame b:handle).*/

         FORM /*GUI*/ 
            skip(2)
/*N0MZ*     {&ecrelsrp_p_3} colon 6 */
/*N0MZ*/    l_msg2 colon 6 no-label
/*H0CH*/ with STREAM-IO /*GUI*/  frame c width 80.

         /* SET EXTERNAL LABELS */
/*N0MZ*  setFrameLabels(frame c:handle). */

         FORM /*GUI*/ 
            skip(2)
            descpt2   no-label  colon 6  format "x(15)"
            ecl_id    no-label  colon 25
/*N0MZ*     "Copy"              colon 65 */
/*N0MZ*/    disp-copy no-label  colon 65
            m         no-label  colon 71 format ">>9"
/*N0MZ*     "of"                colon 74 */
/*N0MZ*/    disp-of   no-label  colon 74
            n         no-label  colon 78 format ">>9"
            skip(1)
         with STREAM-IO /*GUI*/  frame d width 132 side-labels no-box.

         /* SET EXTERNAL LABELS */
/*N0MZ*  setFrameLabels(frame d:handle). */

         set
            ecmnbr
            progtitl
         with frame a.

         bcdparm = "".
         {mfquoter.i ecmnbr}
         {mfquoter.i progtitl}

         {ecselbat.i}

         find ecm_mstr where ecm_nbr = ecmnbr no-lock no-error.
         if not available ecm_mstr then do:
            /* DATA CHANGED AND RERUN THIS PROGRAM REQUIRED */
            {mfmsg.i 5629 3}
            undo, leave.
         end.

         {gprun.i ""ecrels01.p""}

         dtitle = progtitl.
         ecmid = substring(ecm_nbr,9,8).
         dbase = substring(ecm_nbr,17,8).
/*K00C*  find ect_mstr where ect_type = ecm_type and ect_dsgn_grp = */
/*K00C*/ find pct_mstr where pct_type = ecm_type and
                             pct_dsgn_grp = ecm_assign
         no-lock no-error.

/*K00C*  for each ecl_list where ecl_type = "10" and ecl_group = ect_distr */
/*K00C*/ for each pcld_det where pcld_group = pct_distr
         no-lock:

/*K00C*     dev = ecl_dev. */
/*K00C*/    dev = pcld_dev.

            {ecselprt.i dev 132}
            {mfphead.i}

/*K00C*     if ecl_copies = 0 then do: */
/*K00C*/    if pcld_copies = 0 then do:
/*K00C*        display "Distributed to:" @ descpt2 ecl_id
 *             ecl_copies @ m ecl_copies @ n with frame d.
 *K00C* *N0MZ* display {&ecrelsrp_p_2} @ descpt2 pcld_id */
/*N0MZ*/       display
/*N0MZ*/          getTermLabel("DISTRIBUTED_TO",14) + ":" @ descpt2
/*N0MZ*/          pcld_id
/*N0MZ*/          disp-copy
/*N0MZ*/          disp-of
/*K00C*/          pcld_copies @ m
                  pcld_copies @ n
               with frame d STREAM-IO /*GUI*/ .
/*N0MZ*        display with frame b. */
/*N0MZ*/       display
                  l_msg1
               with frame b STREAM-IO /*GUI*/ .
            end.

/*K00C*     else repeat ii = 1 to ecl_copies:
 *             display "Distributed to:" @ descpt2 ecl_id
 *                     ii @ m ecl_copies @ n with frame d.
 *             if ecl__qad02 < today then display with frame c.
 *K00C*/    else repeat ii = 1 to pcld_copies:

/*N0MZ* /*K00C*/ display {&ecrelsrp_p_2} @ descpt2 pcld_id */
/*N0MZ*/       display
/*N0MZ*/          getTermLabel("DISTRIBUTED_TO",14) + ":" @ descpt2
/*N0MZ*/          pcld_id
/*N0MZ*/          disp-copy
/*N0MZ*/          disp-of
/*K00C*/          ii @ m
                  pcld_copies @ n
               with frame d STREAM-IO /*GUI*/ .

/*N0MZ* /*K00C*/ if pcld_expire < today then display with frame c. */
/*N0MZ*/       if pcld_expire < today then
               display
                  l_msg2
               with frame c STREAM-IO /*GUI*/ .
               else do:
                  display
                     {ecform01.i}
                  with frame form01 attr-space side-labels width 132 STREAM-IO /*GUI*/ .
                  display
                     skip(1)
                  with frame x no-label no-box width 132 STREAM-IO /*GUI*/ .
                  display
                     {ecform07.i}
                  with frame form07 attr-space side-labels width 132 STREAM-IO /*GUI*/ .
                  page.
               end.

            end. /* repeat ii */

            {mfreset.i}
/*GUI*/ {mfgrptrm.i} /*Report-to-Window*/

            {mfmsg.i 8 1}

         end. /* for each ecl_list */
